package com.huawei.esdk.tp.cxf.enumgen;

public abstract class RecurrenceFrequencyMapping {

    public final static int DAILY = 0;
    public final static int WEEKLY = 1;
    public final static int MONTHLY = 2;
    public final static int MIN = 0;
    public final static int MAX = 2;
    
	public static Integer enum2Int(RecurrenceFrequency videoFormat) {
		if (null == videoFormat)
        {
            return null;
        }
	    switch (videoFormat) {
		case DAILY: {
			return DAILY;
		}
		case WEEKLY: {
			return WEEKLY;
		}
		case MONTHLY: {
			return MONTHLY;
		}
		default: {
			return null;
		}
		}
	}
	/**
	 * 此处需要加一个默认值
	 * 默认值用于预约会议的时候
	 * 	 * 用户输入错误时，返回错误码
	 * @param num
	 * @return
	 */
	public static RecurrenceFrequency int2Enum(Integer num) {
		if(null==num){
			return null;
		}
		switch (num) {
		case DAILY: {
			return RecurrenceFrequency.DAILY;
		}
		case WEEKLY: {
			return RecurrenceFrequency.WEEKLY;
		}
		case MONTHLY: {
			return RecurrenceFrequency.MONTHLY;
		}
		default: {
			return null;
		}
		}
	}

}
